import { GameGSData } from '../game_for_guosheng/GameGSData';
import { GAMEMODEGS } from '../game_for_guosheng/GameGSDefine';
cc.Class({
    extends: require('BaseGSPanel'),

    properties: {
        labLevel: cc.Label,
        labScore: cc.Label,
        labLevelDes: cc.Label,
    },

    onLoad() {
        this.dnmd();
    },

    onEnter(args, action = true) {
        this.dnmdonEnter(args, action);

        this.labLevel.string = GameGSData.getBestLevel() + 1 + '';
        this.labLevelDes.string = `直接从${GameGSData.getBestLevel() + 1}关开始游戏`;
        this.labScore.string = GameGSData.getBestScore();
    },

    onExit(args) {
        this.dnmdonExit(args);
    },

    FunMudPListener(button) {
        let name = button.node.name;
        if (name == 'btnClose') {
            this._onForGuoShenClose();
        } else if (name == 'btnContinue') {
            F.GSPartner.sendEvent('游戏', { '类型': '最高记录' });
            GameGSData.setGameMode(GAMEMODEGS.BESTSCORE);
            F.Game.loadScene('SceneGame');
            this._onForGuoShenClose();
        }

    },
    // _onTouchStart() {
    // },

});
